package week4;
import java.util.*;

	
	class Fruit extends Object{
		
		String name; 
		Fruit(String name){
			this.name=name;
		}
		
		 public boolean equals(Object obj){
			 if(obj instanceof Fruit) {
				 Fruit a=(Fruit) obj;
				 return this.name.equals(a.name);
				 
			 }
			 return super.equals(obj);
		 }
		
		
	}
	public class boke2 {
	
	public static void main(String[] args) {
		
		//Fruit x=new Fruit("wcy");
		//Fruit y=new Fruit("wcy");
		Scanner sc=new Scanner(System.in);
		ArrayList<Fruit> fruitList=new ArrayList<>();
		while(true) {
			String ss=sc.next();
			if(ss.equals("end"))
				break;
			
				Fruit s1=new Fruit(ss);
				if(!fruitList.contains(s1)) {
					fruitList.add(new Fruit(ss));
					
				
				
			}
			
			
		}
		System.out.println(fruitList.size());
		for(Fruit e :fruitList ) {
			System.out.println(e.name);
		}
		
		//System.out.println(x.equals(y));
	}
		
	}


